package com.heima.controller;

import com.heima.common.PageResult;
import com.heima.pojo.dto.OrderQueryDTO;
import com.heima.pojo.vo.OrderVO;
import com.heima.service.IOderService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/order-service/order")
public class OrderController {

    private final IOderService orderService;

    @GetMapping("/search")
    public PageResult<OrderVO> search(OrderQueryDTO orderQueryDTO) {
        PageResult<OrderVO> pageResult = orderService.search(orderQueryDTO);
        return pageResult;
    }

}
